#include<iostream>
#include<string>
#include<memory>
#include"udp_server.hpp"

static void Usage(std::string proc)
{
    std::cout << "\nUsage:" << proc << "ip port" << std::endl;
}

// ./udp_sever ip port
int main(int argc, char* argv[])
{
    if(argc != 3)
    {
        Usage(argv[0]);
        exit(1);
    }

    uint16_t port = atoi(argv[2]);
    std::string ip = argv[1];
    std::unique_ptr<UdpSever> sever(new UdpSever(port ,ip));
    sever->InitSever();
    sever->Start();
    
}